package org.book.dao;

import org.book.util.JDBC_Util;

public class AdminDaoImp implements AdminDao{

	@Override
	public boolean loginTest(AdminBean admin) {
		String sql = "select count(*) from admin where adminName = ? and password = ?";
		int count = JDBC_Util.superSelect(sql, admin.getAdminName(), admin.getPassword());
		return count>0?true:false;
	}

	@Override
	public boolean registTest(AdminBean admin) {
		String sql = "insert into admin(adminName,password) values(?,?)";
		int count = JDBC_Util.superUpdate(sql, admin.getAdminName(), admin.getPassword());
		return count>0?true:false;
	}

}
